<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="my" uri="http://www.trkj.com/tr1702/tags" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>排版模板</title>
<script type="text/javascript"
	src="<c:url value="/js/jquery-easyui-1.5.4.2/jquery.min.js"/>"></script>
<script type="text/javascript"
	src="<c:url value="/js/jquery-easyui-1.5.4.2/jquery.easyui.min.js"/>"></script>
<script type="text/javascript"
	src="<c:url value="/js/jquery-easyui-1.5.4.2/locale/easyui-lang-zh_CN.js"/>"></script>
<link rel="stylesheet" type="text/css"
	href="<c:url value="/js/jquery-easyui-1.5.4.2/themes/default/easyui.css"/>" />
<link rel="stylesheet" type="text/css"
	href="<c:url value="/js/jquery-easyui-1.5.4.2/themes/icon.css"/>" />
</head>

<body>
	<script type="text/javascript">
		/*删除*/
		 function delschling(SCHEDU_ID) {
			$.messager.confirm('确认', '您确定要删除吗？', function(v) {
				if(v){
				$.post("to_tschedu_delede", {
					scheduId:SCHEDU_ID
				}, function() {
					$('#shq_sch_tb').datagrid('reload');
				});
				}else{
					
				}
			});
		} 
		
		/*操作图标*/
		var schFormatter = function(value, row, index) {
			var dels ="";
			var wrongs = " <a btn='cell_btn_wrongs' onclick='wrongs("
					+ row.SCHEDU_ID + ")'></a>";
			/* var edits = " <a btn='cell_btn_edits' onclick='editssch("
					+ row.SCHEDU_ID +")'></a>"; */
			<my:g id="40">dels = " <a btn='cell_btn_dels' onclick='delschling("
					+ row.SCHEDU_ID + ")'></a>";</my:g>
			return wrongs /* + edits */ + dels;
		}
		$(function() {
			//新增
			$(".addbtns").linkbutton({
				onClick : function() {
					$("#shq_sch_div").panel({
						href : "to_core_schedulingadd"
					});
				}
			});
			/* 操作图*/
			$("#shq_sch_tb").datagrid({
				onLoadSuccess : function() {
					$("a[btn=cell_btn_dels]").linkbutton({
						iconCls : 'icon-cancel',
						plain : true
					});
					$("a[btn=cell_btn_edits]").linkbutton({
						iconCls : 'icon-edit',
						plain : true
					});
				}
			});
		});
	</script>
	<div id="shq_sch_div" class="easyui-panel"
		data-options="fit:true,border:false">
	<table class="easyui-datagrid" id="shq_sch_tb"
		style="width: 100%"
		data-options="
				fitColumns:true,
				fit:true,
				pagination:true,     
				pageSize:5,    
				pageList: [5,10,15,20,25], 
				url:'to_scheduling_template234',
				method:'post',
				rownumbers:true,
				Striped:true, 
				singleSelect:true,
				striped:true,
				toolbar:'#toolsrsch'
        ">
		<thead>
			<tr>
				<th data-options="field:'SCHEDU_ID',width:40,align:'center'">编号</th>
				<th data-options="field:'SCHEDU_NAME',width:50,align:'center'">名称</th>
				<th data-options="field:'SCHEDU_ENABLEDATE',width:100,align:'center',formatter:function(value,row,index){
					if(value!=null){
						var date = new Date(value);
						return date.toLocaleString();
					}
						return;
				}">启用日期</th>
				<th data-options="field:'CYCLE',width:50,align:'center',formatter:function(value,row,index){
					if(value==1){
						return '上班';
					}else if(value==0){
						return '休息';
						}
				}">星期一</th>
				<th data-options="field:'SCHEDU_TEAM',width:50,align:'center',formatter:function(value,row,index){
					if(value==1){
						return '上班';
					}else if(value==0){
						return '休息';
						}
				}">星期二</th>
				<th data-options="field:'SCHEDU_CURRENTCYCLE',width:50,align:'center',formatter:function(value,row,index){
					if(value==1){
						return '上班';
					}else if(value==0){
						return '休息';
						}
				}">星期三</th>
				<th data-options="field:'SCHEDU_CURRENTTEAM',width:50,align:'center',formatter:function(value,row,index){
					if(value==1){
						return '上班';
					}else if(value==0){
						return '休息';
						}
				}">星期四</th>
				<th data-options="field:'SCHEDU_REMARKS',width:50,align:'center',formatter:function(value,row,index){
					if(value==1){
						return '上班';
					}else if(value==0){
						return '休息';
						}
				}">星期五</th>
				<th data-options="field:'SCHEDU_PERSON',width:50,align:'center',formatter:function(value,row,index){
					if(value==1){
						return '上班';
					}else if(value==0){
						return '休息';
						}
				}">星期六</th>
				<th data-options="field:'SCHEDU_STATE',width:50,align:'center',formatter:function(value,row,index){
					if(value==1){
						return '上班';
					}else if(value==0){
						return '休息';
						}
				}">星期天</th>
				<th data-options="field:'m',width:50,align:'center',formatter:schFormatter">操作</th>
			</tr>
		</thead>
		<tbody>

		</tbody>
	</table>
	<!--工具-->
	<div id="toolsrsch" style="padding-left: 30px;">
		<my:g id="39"><a class="easyui-linkbutton addbtns"
			data-options="iconCls:'icon-add'">新增</a></my:g>
			<!-- <input style="margin-left:15px"  class="easyui-searchbox" data-options="label:'搜索文本(名称)', width:250,labelWidth:100,       
			 	searcher:function(value,name){
      			 $('#shq_sch_tb').datagrid('load','?key='+value);      
			 }"/> --> 
	</div>
	 <!-- 编辑的对话框 -->
	<!-- <div id="shq_sch_update_dg" class="easyui-dialog" title="编辑" style="width:400px;height:200px;"   
	        data-options="iconCls:'icon-save',resizable:true,modal:true,bodyCls:'bodyCls',closed:true,
	        buttons:[{
				text:'保存',
				iconCls:'icon-ok',
				handler:function(){
					$('#shq_sch_update').form({
					url:'shq_tran_schling_updates'
						onSubmit:function(params){
							return $('#shq_sch_update_dg').form('validate');
						},
						success:function(v){
							v = eval('(' + v + ')');
							if(v.success){
								$('#shq_sch_tb').datagrid('reload');
								$('#shq_sch_update_dg').dialog('close');
								$('#shq_sch_update').form('reset');
							}else{
								$.messager.alert('错误', v.message);
							}
						}
					}).submit();
				}
			},{
				text:'关闭',
				iconCls:'icon-cancel',
				handler:function(){
					$('#shq_sch_update_dg').dialog('close');
				}
			}]">
	        <form id="shq_sch_update" method="post" action="">
		        	<input type="hidden" name="scheduId" id="scheduIds">
					<input class="easyui-textbox" id="scheduNames" name="scheduName" data-options="label:'模板名称',required:true, width:'90%'">
					<input id="scheduEnabledates" name="scheduEnabledate"class="easyui-datetimebox"data-options="label:'模板启用日期', width:'90%'" />
					<input class="easyui-textbox" id="scheduRemarkss" name="scheduRemarks" data-options="label:'备注', width:'90%'">
			</form>
	</div> -->
	</div>
</body>
</html>